using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db.SupplyChain.Warehouse;
using HengTong.Model.Db.SupplyChain.Material;
using HengTong.Model.Db.SupplyChain.Partner;
using HengTong.Model;


namespace HengTong.ViewModel.SupplyChain.SysWarehouseStockVms
{
    public partial class SysWarehouseStockTemplateVm : BaseTemplateVM
    {
        [Display(Name = "库位")]
        public ExcelPropety LocationExcel = ExcelPropety.CreateProperty<SysWarehouseStock>(x => x.LocationId);
        [Display(Name = "物料")]
        public ExcelPropety MaterialExcel = ExcelPropety.CreateProperty<SysWarehouseStock>(x => x.MaterialId);
        [Display(Name = "数量")]
        public ExcelPropety QuantityExcel = ExcelPropety.CreateProperty<SysWarehouseStock>(x => x.Quantity);
        [Display(Name = "物料SKU")]
        public ExcelPropety SkuExcel = ExcelPropety.CreateProperty<SysWarehouseStock>(x => x.SkuId);
        [Display(Name = "ERP编号")]
        public ExcelPropety ErpIdExcel = ExcelPropety.CreateProperty<SysWarehouseStock>(x => x.ErpId);
        [Display(Name = "批次号")]
        public ExcelPropety BatchNumberExcel = ExcelPropety.CreateProperty<SysWarehouseStock>(x => x.BatchNumber);
        [Display(Name = "供应商")]
        public ExcelPropety PartnerExcel = ExcelPropety.CreateProperty<SysWarehouseStock>(x => x.PartnerId);
        [Display(Name = "存储类型")]
        public ExcelPropety StoreTypeExcel = ExcelPropety.CreateProperty<SysWarehouseStock>(x => x.StoreType);

	    protected override void InitVM()
        {
            LocationExcel.DataType = ColumnDataType.ComboBox;
            LocationExcel.ListItems = DC.Set<SysWarehouseLocation>().GetSelectListItems(Wtm, y => y.Name);
            MaterialExcel.DataType = ColumnDataType.ComboBox;
            MaterialExcel.ListItems = DC.Set<SysMaterial>().GetSelectListItems(Wtm, y => y.Name);
            SkuExcel.DataType = ColumnDataType.ComboBox;
            SkuExcel.ListItems = DC.Set<SysMaterialSku>().GetSelectListItems(Wtm, y => y.Name);
            PartnerExcel.DataType = ColumnDataType.ComboBox;
            PartnerExcel.ListItems = DC.Set<SysPartner>().GetSelectListItems(Wtm, y => y.Name);
        }

    }

    public class SysWarehouseStockImportVm : BaseImportVM<SysWarehouseStockTemplateVm, SysWarehouseStock>
    {

    }

}
